#ifndef _SERVER_POOL_
#define _SERVER_POOL_

#include <my_header.h>
#include "tidArr.h"
#include "taskQueue.h"
#include "./Directory/directory.h"
#include "./Directory/pathStack.h"
/* #include "./SendRecv/head.h" */
#include <unistd.h>
#include "./Directory/serverTrans.h"
#include <shadow.h>
#include <crypt.h>
#include <syslog.h>
//* #include "./Directory/command_file.h" */
typedef struct serverPool_s{
    //子线程的信息数量
    tidArr_t tidArr;
    //任务队列
    taskQueue_t que;
    //锁
    pthread_mutex_t mutex;
    //条件变量
    pthread_cond_t cond;
    //退出标志位
    int exitFlag;
}serverPool_t;
typedef struct signalsend{
    int sig_t;
    int size;
    char pathname[12][32];
}signalsend_t;
typedef struct FileBuf_s{
    int sig_t; //用数字代替信号
    int size; //路径长度
    char buf[1000]; //接收路径
}FileBuf_t;
typedef struct Node
{
    struct Node *next_node;
    char data[50];
} Node_t;

typedef struct linkList
{
    struct Node *head;
    struct Node *tail;
    int length;
} linkList_t;

enum{
    CD,
    LS,
    PWD,
    PUTS,
    GETS,
    REMOVE,
    MKDIR,
    RMDIR
};

int serverPoolInit(serverPool_t *pserver,int workerNum);
int makeWorker(serverPool_t *serverPool);
int initTcp(char *ip,char *port);
int epollAdd(int epfd,int fd);
int epollDel(int epfd,int fd);
bool isTruePath(path_t path,signalsend_t signal);
/* inttransFile(int netfd); */
int remove_file(const char *filename);
int rm_dir(const char *filename);
#endif


